package sf.dsl.example;


/**
 * oracle相关的方法
 */
public class OracleQuery {

    protected static final String CONNECT_BY = " connect by ";

    protected static final String CONNECT_BY_NOCYCLE_PRIOR = " connect by nocycle prior ";

    protected static final String CONNECT_BY_PRIOR = " connect by prior ";

    protected static final String ORDER_SIBLINGS_BY = " order siblings by ";

    protected static final String START_WITH = " start with ";


    /**
     * CONNECT BY specifies the relationship between parent rows and child rows of the hierarchy.
     * @return the current object
     */
    public static ICondition connectByPrior() {
        return QPI.addCondition(CONNECT_BY_PRIOR);
    }

    /**
     * CONNECT BY specifies the relationship between parent rows and child rows of the hierarchy.
     * @return the current object
     */
    public static ICondition connectBy() {
        return QPI.addCondition(CONNECT_BY);
    }

    /**
     * CONNECT BY specifies the relationship between parent rows and child rows of the hierarchy.
     * @return the current object
     */
    public static ICondition connectByNocyclePrior() {
        return QPI.addCondition(CONNECT_BY_NOCYCLE_PRIOR);
    }

    /**
     * START WITH specifies the root row(s) of the hierarchy.
     * @return the current object
     */
    public static ICondition startWith() {
        return QPI.addCondition(START_WITH);
    }

    /**
     * ORDER SIBLINGS BY preserves any ordering specified in the hierarchical query clause and then
     * applies the order_by_clause to the siblings of the hierarchy.
     * @return the current object
     */
    public static ICondition orderSiblingsBy() {
        return QPI.addCondition(ORDER_SIBLINGS_BY);
    }
}


